package com.czbank.financing.controller;

import com.czbank.financing.Entity.Manipulate;
import com.czbank.financing.service.ManipulateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/Manipulate")
public class ManipulatedController {

    @Autowired
    private ManipulateService manipulateService;

    @RequestMapping("/SelectedOneManipulate")
    public Object manipulateSelectedOne(long id) {

        return manipulateService.selectManipulateById(id);
    }

    @RequestMapping("/SelectedAllManipulate")
    public List<Manipulate> manipulateList() {

        return manipulateService.allManipulate();
    }

    @RequestMapping("/InsertManipulate")
    public Object InsertManipulate(String manipulateName, String manipulateDescribe,Date creationtime){
        return manipulateService.InsertManipulate(manipulateName, manipulateDescribe,  creationtime);
    }
}
